import { request } from '@/request'

export const update = <T extends object, R = any>(
  data: T
): Promise<IResponse<R>> => {
  return request.POST<T>({ url: '/app/user/update-profile', params: data })
}

// 获取绑定儿童信息
export const getChildInfo = <R>(data: {
  userId: string
}): Promise<IResponse<IResponseList<R>>> => {
  return request.GET({ url: '/app/user/children', params: data })
}

// 获取用户捐赠情况
export const getDonationStatus = <R>(data: {
  userId: string
}): Promise<IResponse<IResponseList<R>>> => {
  return request.GET({ url: '/app/user/certificates', params: data })
}
